package com.dynamic.datasource.demo.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dynamic.datasource.demo.entity.Product;
import com.dynamic.datasource.demo.mapper.ProductMapper;
import com.dynamic.datasource.demo.service.IProductService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 产品信息表 服务实现类
 * </p>
 *
 * @author hh
 * @since 2023-02-04
 */
@Service
@DS("master")
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {


    @DS("master")
    @Override
    public List<Product> selectFromMaster() {
        return list();
    }

    @DS("slave1")
    @Override
    public List<Product> selectFromSlave1() {
        return list();
    }

    @DS("slave2")
    @Override
    public List<Product> selectFromSlave2() {
        return list();
    }
}
